module.exports = {

  lintOnSave: false,
  publicPath: process.env.NODE_ENV === 'development' ? '' : './',
  chainWebpack: config => {
    config.module
      .rule('images')
      .use('url-loader')
      .loader('url-loader')
      .tap(options => Object.assign(options, { limit: 10240 }))
  },
  configureWebpack: {
    externals: {
      // 此处引号中的urlConfig必须和window.urlConfig一致
      BMap: 'BMap'
    }
  },
  devServer: {
    host: '127.0.0.1',
    port: 8011,
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:3000',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }
}
